<style>
     .layui-form-item .required:after {
        content: '*';
        color: red;
        position: absolute;
        margin-left: 4px;
        font-weight: bold;
        line-height: 1.8em;
        top: 6px;
        right: 5px;
    }
     .layui-form-item > .layui-input-block tip, .layui-form-item > .layui-inline tip {
         display: inline-block;
         margin-top: 10px;
         line-height: 15px;
         font-size: 10px;
         color: #a29c9c;
     }
</style>
<div class="layuimini-container">

        <div class="layui-form-item">
            <label class="layui-form-label required">商品分类</label>
            <div class="layui-input-block">
                <select name="cate_id" lay-verify="required" data-select="{:url('mall.cate/getCatelist',array('cat_type'=>0))}" data-fields="id,title" data-value="{$row.cate_id}">
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">商品标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" maxlength="50" class="layui-input" lay-verify="required" placeholder="请输入商品标题" value="{$row.title}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">商品副标题</label>
            <div class="layui-input-block">
                <input type="text" name="short_title" maxlength="100" class="layui-input" placeholder="请输入商品副标题" value="{$row.short_title}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">所属商家</label>
            <div class="layui-input-block">
                {if condition="$type eq 1"}
                <select name="manager_id" id="manager_id" disabled lay-filter="manager" lay-verify="required" data-select="{:url('mall.manager/index')}" data-fields="id,title" data-value="{$row.manager_id}">
                </select>
                {else /}
                <select name="manager_id" id="manager_id" lay-filter="manager" lay-verify="required" data-select="{:url('mall.manager/index')}" data-fields="id,title" data-value="{$row.manager_id}">
                </select>
                {/if}
                <input type="hidden" id="managerids" value="{$row.manager_id}">
                <input type="hidden" id="type" value="{$type}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">关联门店</label>
            <div class="layui-input-block" id="goodsdoors">
                <input type="hidden" id="door_ids" name="doors" value="{$row.doors}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">商品标签</label>
            <div class="layui-input-block" id="goodstags">
                <input type="hidden" id="tag_ids" name="tags" value="{$row.tags}">
            </div>
        </div>
    <div class="layui-form-item">
        <label class="layui-form-label">选择规格</label>
        <div class="layui-input-block">
            <input type="radio" name="specifications" lay-filter="cate" value="0" title="单规格" {if condition="$row.specifications == 0"}checked{/if}>
            <input type="radio" name="specifications" lay-filter="cate" value="1" title="多规格" {if condition="$row.specifications == 1"}checked{/if}>
        </div>
    </div>
    <div class="specs_one" {if condition="$row.specifications == 1"}style="display:none"{/if}>
        <div class="layui-form-item">
            <label class="layui-form-label required">市场价格</label>
            <div class="layui-input-block">
                <input type="text" name="market_price" class="layui-input" lay-verify="required" placeholder="请输入市场价格" value="{$row.market_price}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">销售价格</label>
            <div class="layui-input-block">
                <input type="text" name="goods_price" class="layui-input" lay-verify="required" placeholder="请输入销售价格" value="{$row.goods_price}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">成本价格</label>
            <div class="layui-input-block">
                <input type="text" name="cost_price" class="layui-input" lay-verify="required" placeholder="请输入成本价格" value="{$row.cost_price}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">剩余库存</label>
            <div class="layui-input-block">
                <input type="text" name="stock" class="layui-input" lay-verify="required" placeholder="请输入剩余库存" value="{$row.stock}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">总库存</label>
            <div class="layui-input-block">
                <input type="text" name="total_stock" class="layui-input"  lay-verify="required" placeholder="请输入总库存" value="{$row.total_stock}">
            </div>
        </div>
    </div>
    <div class="specs_two" {if condition="$row.specifications == 0"}style="display:none"{/if}>

        <div class="layui-form-item">
            <label class="layui-form-label">规格：</label>
            <div class="layui-input-block">
                <a class="layui-btn layui-btn-primary" data-open="mall.goods/dialog" data-title="添加规格"
                   data-full="false">添加规格</a>
                <table class="layui-table" id="spec-table">
                    <thead>
                    <tr>
                        <th>规格名</th>
                        <th>规格值</th>
                    </tr>
                    </thead>
                    <input type="hidden" name="id" value="{$id}" id="goods_id">
                    <tbody class="skus-warp">
                    {volist name="tree" id="vo"}
                    <tr>
                        <td data-id="{$vo.id}">{$vo.specs_title}</td>
                        <td>
                            {volist name="vo.child" id="v"}
                            <input type="checkbox" title="{$v.title}" lay-filter="filter" value="{$v.id}" {if condition="$v.checked eq 'checked'"}checked{/if}>
                            {/volist}
                        </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </div>
        </div>
        <div class="layui-form-item layui-hide">
            <label class="layui-form-label">SKU表：</label>
            <div class="layui-input-block">
                <table class="layui-table" id="sku-table">
                    <thead></thead>
                    <tbody></tbody>
                </table>
            </div>
        </div>
    </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">销量</label>
            <div class="layui-input-block">
                <input type="text" name="sales" class="layui-input" lay-verify="required" placeholder="请输入销量" value="{$row.sales}">
                <tip>设置销量后，实际购买销量将会累加</tip>
            </div>
        </div>

        <div class="hr-line"></div>
</div>
